<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ad extends MY_Controller {
    private $token;
    public function __construct()
    {
        parent::__construct();
        $this->load->model("ad_model","ad");
        //$this->load->model("general_message_model","general");
        // $this->token = $this->json_content['token']?$this->json_content['token']:"";
        // //验证登录状态
        // if(!$this->check_login_status($this->token)){
        //     $this->errorCode = API_ERROR_UNLOGIN;
        //     $this->createApi(); exit();
        // }
    }
    /**
     *------------------------------------------------------------------------------------------------------------------
     * @title：头部bannenr广告接口
     * @action：/ad/index
     * @method：POST
     * @author:：柏凯
     * @date：2015-09-04
     *------------------------------------------------------------------------------------------------------------------
     */
	public function AdList(){

        $filds = " id, Adtype, showtype, imgurl, Adcontent";
        //基本信息
        $AdList = array();
        $AdList = $this->ad->getAdList($filds);
        foreach($AdList as $key=>$row){
            $AdList[$key]['imgurl'] = OSSHOST.$row['imgurl'];
        }
        $this->createApi($AdList);
        exit();
    }
    public function categoryList(){

        $filds = " id, Adtype, showtype, imgurl, Adcontent";
        //基本信息
	    $AdList = array();
        $type = 1;
        $AdList = $this->ad->getAdList($type);
        foreach($AdList as $key=>$row){
            $AdList[$key]['imgurl'] = OSSHOST.$row['imgurl'];
        }
        $this->createApi($AdList);
        exit();
    }


    public function ItemIdList(){

        $filds = " id, redirecturl, remark, imgurl";
        //基本信息
	    $AdList = array();
        $AdList = $this->ad->getItemAdList($filds);
        foreach($AdList as $key=>$row){
            $AdList[$key]['imgurl'] = OSSHOST.$row['imgurl'];
        }
        $this->createApi($AdList);
        exit();
    }



}

/* End of file me.php */
/* Location: ./application/controllers/me.php */
